package com.lyncc.netty.codec.lengthFieldBasedFrame;

 
import io.netty.channel.ChannelHandlerContext;

import io.netty.channel.ChannelInboundHandlerAdapter;

 
public class CustomClientHandler extends ChannelInboundHandlerAdapter {

 
@Override

public void channelActive(ChannelHandlerContext ctx) throws Exception {
	

String reqMsg="<service><prcscd>pfms03</prcscd>\r\n" +
		"<servtp>HZF</servtp>\r\n" + 
		"<servsq>20200608000000000001</servsq>\r\n" + 
		"<userid>0170901</userid>\r\n" + 
		"<brchno>017001</brchno>\r\n" + 
		"<job_number>GH88888888</job_number>\r\n" +
		"<name>测试小陈</name>\r\n" +
		"<sex>男</sex>\r\n" +
        "<birthday>134</birthday>\r\n" +
        "<organ_dept_name>2341341</organ_dept_name>\r\n" +
        "<nation>1</nation>\r\n" +
        "<is_store>1</is_store>\r\n" +
        "<id_card>1</id_card>\r\n" +
        "<political_status>1</political_status>\r\n" +
        "<name_once_used>1</name_once_used>\r\n" +
        "<file_number>1</file_number>\r\n" +
        "<birth_place>1</birth_place>\r\n" +
        "<native_place>1</native_place>\r\n" +
        "<in_work_day>2020-03-11</in_work_day>\r\n" +
        "<is_league_member>1</is_league_member>\r\n" +
        "<in_member_day>2020-03-11</in_member_day>\r\n" +
        "<in_party_day>2020-03-11</in_party_day>\r\n" +
        "<health_condition>1</health_condition>\r\n" +
        "<full_education_degree>1</full_education_degree>\r\n" +
        "<full_colleges_majors>1</full_colleges_majors>\r\n" +
        "<part_education_degree>1</part_education_degree>\r\n" +
        "<part_colleges_majors>1</part_colleges_majors>\r\n" +
        "<now_post>1</now_post>\r\n" +
        "<establishment_organization>1</establishment_organization>\r\n" +
        "<secondary_organization>21</secondary_organization>\r\n" +
        "<station>1</station>\r\n" +
        "<post>1</post>\r\n" +
        "<line>1</line>\r\n" +
        "<nature_employment>1</nature_employment>\r\n" +
        "<rank>1</rank>\r\n" +
        "<person_state>1</person_state>\r\n" +
        "<is_manager>1</is_manager>\r\n" +

        "<jobresume>\n" +
        "<record>\n" +
        "<begin_time>2020-03-11</begin_time>\r\n" +
        "<end_time>2020-03-11</end_time>\r\n" +
        "<post>职务</post>\r\n" +
        "<operate>edit</operate>\r\n" +
        "<company>112</company>\r\n" +
        "</record>\n" +
        "<record>\n" +
        "<begin_time>2020-03-11</begin_time>\r\n" +
        "<end_time>2020-03-11</end_time>\r\n" +
        "<post>职务</post>\r\n" +
        "<operate>edit</operate>\r\n" +
        "<company>112</company>\r\n" +
        "</record>\n" +

        "</jobresume>\r\n"+

        "<education>\n" +
        "<record>\n" +
        "<in_school_day>2020-03-11</in_school_day>\r\n" +
        "<school_name>2020-03-11</school_name>\r\n" +
        "<major_name>2020-03-11</major_name>\r\n" +
        "<education_level>本科</education_level>\r\n" +
        "</record>\n" +
        "<record>\n" +
        "<in_school_day>2020-03-11</in_school_day>\r\n" +
        "<school_name>2020-03-11</school_name>\r\n" +
        "<major_name>2020-03-11</major_name>\r\n" +
        "<education_level>本科</education_level>\r\n" +
        "</record>\n" +
        "</education>\r\n"+

		"</service>";

CustomMsg customMsg = new CustomMsg((byte)0xAB, (byte)0xCD, "Hello,Netty".length(), "Hello,Netty");

//CustomMsg customMsg = new CustomMsg((byte)0xAB, (byte)0xCD, reqMsg.length(), reqMsg);


ctx.writeAndFlush(customMsg);

}

 
}